REDDA - Red de Depósito Atmosférico
# RED DE DEPÓSITO ATMOSFÉRICO - REDDA
# 2010
# redda10_A <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/10REDDA/2010CAH.xls", sheet = 1, header = TRUE)
# redda10_B <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/10REDDA/2010CEH.xls", sheet = 1, header = TRUE)
# redda10_C <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/10REDDA/2010CLH.xls", sheet = 1, header = TRUE)
# redda10_D <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/10REDDA/2010HH.xls", sheet = 1, header = TRUE)
# redda10_E <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/10REDDA/2010KH.xls", sheet = 1, header = TRUE)
# redda10_F <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/10REDDA/2010MGH.xls", sheet = 1, header = TRUE)
# redda10_G <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/10REDDA/2010NAH.xls", sheet = 1, header = TRUE)
# redda10_H <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/10REDDA/2010NH4H.xls", sheet = 1, header = TRUE)
# redda10_I <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/10REDDA/2010NO3H.xls", sheet = 1, header = TRUE)
# redda10_J <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/10REDDA/2010PHH.xls", sheet = 1, header = TRUE)
# redda10_K <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/10REDDA/2010PPH.xls", sheet = 1, header = TRUE)
# redda10_L <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/10REDDA/2010SO4H.xls", sheet = 1, header = TRUE)
#
# redda10_A_tidy <- redda10_A %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "CAH")
# redda10_B_tidy <- redda10_B %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "CEH")
# redda10_C_tidy <- redda10_C %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "CLH")
# redda10_D_tidy <- redda10_D %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "HH")
# redda10_E_tidy <- redda10_E %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "KH")
# redda10_F_tidy <- redda10_F %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "MGH")
# redda10_G_tidy <- redda10_G %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "NAH")
# redda10_H_tidy <- redda10_H %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "NA4H")
# redda10_I_tidy <- redda10_I %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "NO3H")
# redda10_J_tidy <- redda10_J %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "PH")
# redda10_K_tidy <- redda10_K %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "PPH")
# redda10_L_tidy <- redda10_L %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "SO4H")
#
# redda10 <- Reduce(function(...) merge(..., all=T), list(redda10_A_tidy, redda10_B_tidy, redda10_C_tidy, redda10_D_tidy, redda10_E_tidy, redda10_F_tidy, redda10_G_tidy, redda10_H_tidy, redda10_I_tidy, redda10_J_tidy, redda10_K_tidy, redda10_L_tidy))
#
# # 2011
#
# redda11_A <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/11REDDA/2011CAH.xls", sheet = 1, header = TRUE)
# redda11_B <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/11REDDA/2011CEH.xls", sheet = 1, header = TRUE)
# redda11_C <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/11REDDA/2011CLH.xls", sheet = 1, header = TRUE)
# redda11_D <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/11REDDA/2011HH.xls", sheet = 1, header = TRUE)
# redda11_E <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/11REDDA/2011KH.xls", sheet = 1, header = TRUE)
# redda11_F <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/11REDDA/2011MGH.xls", sheet = 1, header = TRUE)
# redda11_G <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/11REDDA/2011NAH.xls", sheet = 1, header = TRUE)
# redda11_H <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/11REDDA/2011NH4H.xls", sheet = 1, header = TRUE)
# redda11_I <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/11REDDA/2011NO3H.xls", sheet = 1, header = TRUE)
# redda11_J <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/11REDDA/2011PHH.xls", sheet = 1, header = TRUE)
# redda11_K <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/11REDDA/2011PPH.xls", sheet = 1, header = TRUE)
# redda11_L <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/11REDDA/2011SO4H.xls", sheet = 1, header = TRUE)
#
#
# redda11_A_tidy <- redda11_A %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "CAH")
# redda11_B_tidy <- redda11_B %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "CEH")
# redda11_C_tidy <- redda11_C %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "CLH")
# redda11_D_tidy <- redda11_D %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "HH")
# redda11_E_tidy <- redda11_E %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "KH")
# redda11_F_tidy <- redda11_F %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "MGH")
# redda11_G_tidy <- redda11_G %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "NAH")
# redda11_H_tidy <- redda11_H %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "NA4H")
# redda11_I_tidy <- redda11_I %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "NO3H")
# redda11_J_tidy <- redda11_J %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "PH")
# redda11_K_tidy <- redda11_K %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "PPH")
# redda11_L_tidy <- redda11_L %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "SO4H")
#
# redda11 <- Reduce(function(...) merge(..., all=T), list(redda11_A_tidy, redda11_B_tidy, redda11_C_tidy, redda11_D_tidy, redda11_E_tidy, redda11_F_tidy, redda11_G_tidy, redda11_H_tidy, redda11_I_tidy, redda11_J_tidy, redda11_K_tidy, redda11_L_tidy))
#
# # 2012
#
# redda12_A <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/12REDDA/2012CAH.xls", sheet = 1, header = TRUE)
# redda12_B <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/12REDDA/2012CEH.xls", sheet = 1, header = TRUE)
# redda12_C <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/12REDDA/2012CLH.xls", sheet = 1, header = TRUE)
# redda12_D <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/12REDDA/2012HH.xls", sheet = 1, header = TRUE)
# redda12_E <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/12REDDA/2012KH.xls", sheet = 1, header = TRUE)
# redda12_F <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/12REDDA/2012MGH.xls", sheet = 1, header = TRUE)
# redda12_G <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/12REDDA/2012NAH.xls", sheet = 1, header = TRUE)
# redda12_H <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/12REDDA/2012NH4H.xls", sheet = 1, header = TRUE)
# redda12_I <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/12REDDA/2012NO3H.xls", sheet = 1, header = TRUE)
# redda12_J <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/12REDDA/2012PHH.xls", sheet = 1, header = TRUE)
# redda12_K <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/12REDDA/2012PPH.xls", sheet = 1, header = TRUE)
# redda12_L <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/12REDDA/2012SO4H.xls", sheet = 1, header = TRUE)
#
# redda12_A_tidy <- redda12_A %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "CAH")
# redda12_B_tidy <- redda12_B %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "CEH")
# redda12_C_tidy <- redda12_C %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "CLH")
# redda12_D_tidy <- redda12_D %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "HH")
# redda12_E_tidy <- redda12_E %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "KH")
# redda12_F_tidy <- redda12_F %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "MGH")
# redda12_G_tidy <- redda12_G %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "NAH")
# redda12_H_tidy <- redda12_H %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "NA4H")
# redda12_I_tidy <- redda12_I %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "NO3H")
# redda12_J_tidy <- redda12_J %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "PH")
# redda12_K_tidy <- redda12_K %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "PPH")
# redda12_L_tidy <- redda12_L %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "SO4H")
#
# redda12 <- Reduce(function(...) merge(..., all=T), list(redda12_A_tidy, redda12_B_tidy, redda12_C_tidy, redda12_D_tidy, redda12_E_tidy, redda12_F_tidy, redda12_G_tidy, redda12_H_tidy, redda12_I_tidy, redda12_J_tidy, redda12_K_tidy, redda12_L_tidy))
#
# # 2013
#
# redda13_A <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/13REDDA/2013CAH.xls", sheet = 1, header = TRUE)
# redda13_B <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/13REDDA/2013CEH.xls", sheet = 1, header = TRUE)
# redda13_C <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/13REDDA/2013CLH.xls", sheet = 1, header = TRUE)
# redda13_D <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/13REDDA/2013HH.xls", sheet = 1, header = TRUE)
# redda13_E <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/13REDDA/2013KH.xls", sheet = 1, header = TRUE)
# redda13_F <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/13REDDA/2013MGH.xls", sheet = 1, header = TRUE)
# redda13_G <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/13REDDA/2013NAH.xls", sheet = 1, header = TRUE)
# redda13_H <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/13REDDA/2013NH4H.xls", sheet = 1, header = TRUE)
# redda13_I <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/13REDDA/2013NO3H.xls", sheet = 1, header = TRUE)
# redda13_J <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/13REDDA/2013PHH.xls", sheet = 1, header = TRUE)
# redda13_K <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/13REDDA/2013PPH.xls", sheet = 1, header = TRUE)
# redda13_L <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/13REDDA/2013SO4H.xls", sheet = 1, header = TRUE)
#
# redda13_A_tidy <- redda13_A %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "CAH")
# redda13_B_tidy <- redda13_B %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "CEH")
# redda13_C_tidy <- redda13_C %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "CLH")
# redda13_D_tidy <- redda13_D %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "HH")
# redda13_E_tidy <- redda13_E %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "KH")
# redda13_F_tidy <- redda13_F %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "MGH")
# redda13_G_tidy <- redda13_G %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "NAH")
# redda13_H_tidy <- redda13_H %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "NA4H")
# redda13_I_tidy <- redda13_I %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "NO3H")
# redda13_J_tidy <- redda13_J %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "PH")
# redda13_K_tidy <- redda13_K %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "PPH")
# redda13_L_tidy <- redda13_L %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "SO4H")
#
# redda13 <- Reduce(function(...) merge(..., all=T), list(redda13_A_tidy, redda13_B_tidy, redda13_C_tidy, redda13_D_tidy, redda13_E_tidy, redda13_F_tidy, redda13_G_tidy, redda13_H_tidy, redda13_I_tidy, redda13_J_tidy, redda13_K_tidy, redda13_L_tidy))
#
# # 2014
#
# redda14_A <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/14REDDA/2014CAH.xls", sheet = 1, header = TRUE)
# redda14_B <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/14REDDA/2014CEH.xls", sheet = 1, header = TRUE)
# redda14_C <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/14REDDA/2014CLH.xls", sheet = 1, header = TRUE)
# redda14_D <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/14REDDA/2014HH.xls", sheet = 1, header = TRUE)
# redda14_E <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/14REDDA/2014KH.xls", sheet = 1, header = TRUE)
# redda14_F <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/14REDDA/2014MGH.xls", sheet = 1, header = TRUE)
# redda14_G <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/14REDDA/2014NAH.xls", sheet = 1, header = TRUE)
# redda14_H <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/14REDDA/2014NH4H.xls", sheet = 1, header = TRUE)
# redda14_I <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/14REDDA/2014NO3H.xls", sheet = 1, header = TRUE)
# redda14_J <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/14REDDA/2014PHH.xls", sheet = 1, header = TRUE)
# redda14_K <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/14REDDA/2014PPH.xls", sheet = 1, header = TRUE)
# redda14_L <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/14REDDA/2014SO4H.xls", sheet = 1, header = TRUE)
#
# redda14_A_tidy <- redda14_A %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "CAH")
# redda14_B_tidy <- redda14_B %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "CEH")
# redda14_C_tidy <- redda14_C %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "CLH")
# redda14_D_tidy <- redda14_D %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "HH")
# redda14_E_tidy <- redda14_E %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "KH")
# redda14_F_tidy <- redda14_F %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "MGH")
# redda14_G_tidy <- redda14_G %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "NAH")
# redda14_H_tidy <- redda14_H %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "NA4H")
# redda14_I_tidy <- redda14_I %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "NO3H")
# redda14_J_tidy <- redda14_J %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "PH")
# redda14_K_tidy <- redda14_K %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "PPH")
# redda14_L_tidy <- redda14_L %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "SO4H")
#
# redda14 <- Reduce(function(...) merge(..., all=T), list(redda14_A_tidy, redda14_B_tidy, redda14_C_tidy, redda14_D_tidy, redda14_E_tidy, redda14_F_tidy, redda14_G_tidy, redda14_H_tidy, redda14_I_tidy, redda14_J_tidy, redda14_K_tidy, redda14_L_tidy))
#
# # 2015
#
# redda15_A <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/15REDDA/2015CAH.xls", sheet = 1, header = TRUE)
# redda15_B <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/15REDDA/2015CEH.xls", sheet = 1, header = TRUE)
# redda15_C <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/15REDDA/2015CLH.xls", sheet = 1, header = TRUE)
# redda15_D <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/15REDDA/2015HH.xls", sheet = 1, header = TRUE)
# redda15_E <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/15REDDA/2015KH.xls", sheet = 1, header = TRUE)
# redda15_F <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/15REDDA/2015MGH.xls", sheet = 1, header = TRUE)
# redda15_G <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/15REDDA/2015NAH.xls", sheet = 1, header = TRUE)
# redda15_H <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/15REDDA/2015NH4H.xls", sheet = 1, header = TRUE)
# redda15_I <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/15REDDA/2015NO3H.xls", sheet = 1, header = TRUE)
# redda15_J <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/15REDDA/2015PHH.xls", sheet = 1, header = TRUE)
# redda15_K <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/15REDDA/2015PPH.xls", sheet = 1, header = TRUE)
# redda15_L <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/15REDDA/2015SO4H.xls", sheet = 1, header = TRUE)
#
# redda15_A_tidy <- redda15_A %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "CAH")
# redda15_B_tidy <- redda15_B %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "CEH")
# redda15_C_tidy <- redda15_C %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "CLH")
# redda15_D_tidy <- redda15_D %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "HH")
# redda15_E_tidy <- redda15_E %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "KH")
# redda15_F_tidy <- redda15_F %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "MGH")
# redda15_G_tidy <- redda15_G %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "NAH")
# redda15_H_tidy <- redda15_H %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "NA4H")
# redda15_I_tidy <- redda15_I %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "NO3H")
# redda15_J_tidy <- redda15_J %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "PH")
# redda15_K_tidy <- redda15_K %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "PPH")
# redda15_L_tidy <- redda15_L %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "SO4H")
#
# redda15 <- Reduce(function(...) merge(..., all=T), list(redda15_A_tidy, redda15_B_tidy, redda15_C_tidy, redda15_D_tidy, redda15_E_tidy, redda15_F_tidy, redda15_G_tidy, redda15_H_tidy, redda15_I_tidy, redda15_J_tidy, redda15_K_tidy, redda15_L_tidy))
#
# # 2016
#
# redda16_A <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/16REDDA/2016CAH.xls", sheet = 1, header = TRUE)
# redda16_B <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/16REDDA/2016CEH.xls", sheet = 1, header = TRUE)
# redda16_C <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/16REDDA/2016CLH.xls", sheet = 1, header = TRUE)
# redda16_D <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/16REDDA/2016HH.xls", sheet = 1, header = TRUE)
# redda16_E <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/16REDDA/2016KH.xls", sheet = 1, header = TRUE)
# redda16_F <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/16REDDA/2016MGH.xls", sheet = 1, header = TRUE)
# redda16_G <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/16REDDA/2016NAH.xls", sheet = 1, header = TRUE)
# redda16_H <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/16REDDA/2016NH4H.xls", sheet = 1, header = TRUE)
# redda16_I <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/16REDDA/2016NO3H.xls", sheet = 1, header = TRUE)
# redda16_J <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/16REDDA/2016PHH.xls", sheet = 1, header = TRUE)
# redda16_K <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/16REDDA/2016PPH.xls", sheet = 1, header = TRUE)
# redda16_L <- read.xls("/Users/Vanessa/Desktop/Datos_Excel/REDDA/16REDDA/2016SO4H.xls", sheet = 1, header = TRUE)
#
# redda16_A_tidy <- redda16_A %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "CAH")
# redda16_B_tidy <- redda16_B %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "CEH")
# redda16_C_tidy <- redda16_C %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "CLH")
# redda16_D_tidy <- redda16_D %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "HH")
# redda16_E_tidy <- redda16_E %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "KH")
# redda16_F_tidy <- redda16_F %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "MGH")
# redda16_G_tidy <- redda16_G %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "NAH")
# redda16_H_tidy <- redda16_H %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "NA4H")
# redda16_I_tidy <- redda16_I %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "NO3H")
# redda16_J_tidy <- redda16_J %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "PH")
# redda16_K_tidy <- redda16_K %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "PPH")
# redda16_L_tidy <- redda16_L %>% gather(estaciones, valor, LOM:LAA, -FECHA) %>% mutate(pollutant = "SO4H")
#
# redda16 <- Reduce(function(...) merge(..., all=T), list(redda16_A_tidy, redda16_B_tidy, redda16_C_tidy, redda16_D_tidy, redda16_E_tidy, redda16_F_tidy, redda16_G_tidy, redda16_H_tidy, redda16_I_tidy, redda16_J_tidy, redda16_K_tidy, redda16_L_tidy))
# NO HAY 2017
# redda <- rbind(redda10, redda11, redda13, redda14, redda15, redda16) # Arreglar REDDA 12
# redda$FECHA <- as.Date(redda$FECHA)
redda <- read.csv("/Users/Vanessa/Desktop/Datos_Excel/redda.csv")
# write_csv(redda, "/Users/Vanessa/Desktop/Datos_Excel/redda.csv")
# %>% mutate(imeca = convert_to_imeca(valor, pollutant = pollutant, showWarnings = F))
write_csv(redda, "/Users/Vanessa/Desktop/CSV/redda.csv")
Serie de Tiempo por Pollutant (17) con REDDA
reddag <- ggplotly(ggplot(redda, aes(x = FECHA, y = valor, color = estaciones)) + geom_line() + facet_grid(pollutant ~ .) + theme_bw() )
## We recommend that you use the dev version of ggplot2 with `ggplotly()`
## Install it with: `devtools::install_github('hadley/ggplot2')`
reddag
reddag2 <- ggplotly(ggplot(redda, aes(x = FECHA, y = valor, color = pollutant)) + geom_line() + facet_grid(estaciones ~ .) + theme_bw() )
## We recommend that you use the dev version of ggplot2 with `ggplotly()`
## Install it with: `devtools::install_github('hadley/ggplot2')`
reddag2